package com.imooc.demo.pingshu;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.seimicrawler.xpath.JXDocument;
import org.seimicrawler.xpath.JXNode;

import java.io.IOException;
import java.util.List;

//@SpringBootApplication
public class DetailDownThread extends  Thread{

	private final String url;

	public static void log(String log){
		System.out.println("log-> "+log );
	}

	public static final String  host = "https://www.pingshu365.com/play/441638.html";

	public DetailDownThread(String spliderUrl){
		this.url = spliderUrl;
	}


	@Override
	public void run() {
		super.run();

//		Document doc = null;
//		try {
//			doc = Jsoup.connect(host)
//                    .header("Accept", "*/*")
//                    .header("Accept-Encoding", "gzip, deflate")
//                    .header("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3")
//                    .header("Content-Type", "application/json;charset=UTF-8")
//                    .header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0")
//                    .timeout(10000).ignoreContentType(true).get();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}

//		JXDocument jxDocument = JXDocument.createByUrl(host);


//		log(jxDocument.toString());

//		List<JXNode> jxfnNodes = jxDocument.selN("//span[@class='musicname']/text()");
//
//		String fnString = jxfnNodes.get(0).asString();
//
//		log(fnString);

//
//		List<JXNode> jxNodes = jxDocument.selN("//audio[@id='jp_audio_0']/@src");
////
//
//		for (JXNode node :jxNodes) {
//
//			log(node.toString());
//
//
//		}


//		String downloadurl = jxNodes.toString();
//
//		log(downloadurl);



	}




}
